﻿@using Webdiyer.WebControls.Mvc
@model Webdiyer.WebControls.Mvc.PagedList<GongXianDCUI.Models.Article>
@{
    GongXianDCUI.Models.Funcitions functions2 = ViewBag.Menu as GongXianDCUI.Models.Funcitions;
    ViewBag.Title = functions2.FunctionName;

}
<link href="~/content/dianli/css/lh.css" rel="stylesheet" type="text/css" />
<style>
.uu{
	margin-left:25px;
	display:none;
}
.uu a{
	font-size:12px;
}
.uuspan{
	font-size:20px;
	top:12px;
	float:left;
}
 
</style>
<script>
function bg(id)
{
	var	iss=$("."+id).css("display")=="none"?"block":"none";
	$("."+id).css("display",iss);
}
$(function(){
	bg(@functions2.ChildrenID);
});
</script>
<div class="bg">
    <div class="nt">
        <div class="Main">
            <div class="nr">
                <div id="leftMenus" class="nleft">
                    <div class="nlt">
                        @functions2.FunctionName<br />
                        <span>NEWS</span>
                    </div>
                    @foreach (GongXianDCUI.Models.Funcitions item in functions2.Childrens)
                    {
						GongXianDCUI.BLL.FunctionsBLL bll=new GongXianDCUI.BLL.FunctionsBLL(); 
						List<GongXianDCUI.Models.Funcitions>list=bll.GetFuncitionsList(item.FunctionId);
						string ab= item.FunctionName == functions2.ChildrenName?"nleftGaoLiang":"";
						if(list.Count<1){
								
								<a class="@ab" href="~/FenBuList/ArticleList/@item.FunctionId">@item.FunctionName</a>
						}
						else{
							<a class="@ab" href="javascript:bg(@item.FunctionId)"><span class="uuspan">△</span>@item.FunctionName</a>
							<ul class="@item.FunctionId  uu">
								 @foreach (var fun in list)
								 {
									string styles= ViewBag.miniName+""==fun.FunctionName?"nleftGaoLiang":"";
									<li>
										<a class="@styles" href="~/FenBuList/ArticleList/@fun.FunctionId">@fun.FunctionName</a>
									</li>
								}
							</ul>
						}
                    }
                </div>
                <div class="nright">
                    <div class="wz">
                        <img src="~/content/dianli/images/wz.jpg" /><span><a href="~/home/index">首页</a><span style="padding-right:5px;padding-left:5px;">&gt;</span><a href="~/FenBuList/ArticleList/@functions2.FunctionId">@functions2.FunctionName</a><span style="padding-right: 5px; padding-left: 5px;">&gt;</span>@functions2.ChildrenName</span>
                    </div>
                    <div class="nhx">
                    </div>
                    <div class="nnr">
                        @if (Model.Count > 0)
                        {
                            foreach (GongXianDCUI.Models.Article item in Model)
                            {
                                <div class="ngsxws">
                                    <div class="dians">
                                    </div>
                                    <div class="xwtits">
                                        <a href="~/FenBuList/Detail/@item.articleId">
                                            @item.title
                                            @if (item.picFlag == "1")
                                            {
                                                <span class="listItem_pic"></span>
                                            }
                                            @if (item.newFlag == "1")
                                            {
                                                <span class="listItem_new"></span>
                                            }
                                            else if (item.hotFlag == "1")
                                            {
                                                <span class="listItem_hot"></span>
                                            }
                                        </a>
                                    </div>
                                    <div class="rqs">
                                        <span>
                                            @item.pubdate
                                            @if (item.hits > 999)
                                            {
                                                <span style="width:55px;display:inline-block;text-align:right;">(999+)阅</span>
                                            }
                                            else
                                            {
                                                <span style="width:55px;display:inline-block;text-align:right;">(@item.hits)阅</span>
                                            }                                            
                                        </span>
                                    </div>
                                </div>
                            }
                            <div class="hx"></div>
                            <div class="fy">共有 @Model.TotalItemCount 条信息</div>
                            <div class="fys">
                                @Html.Pager(Model, new PagerOptions { PageIndexParameterName = "pageIndex", CurrentPagerItemTemplate = "<span class=\"current\">{0}</span>", DisabledPagerItemTemplate = "<span class=\"disabled\">{0}</span>", Id = "diggpager" })
                            </div>
                        }
                        else
                        {
                            <span style="color: red; font-size: 16px; font-weight: bold; font-family: 宋体;">暂无数据</span>
                        }
                        <div class="kong"></div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    //$(document).ready(function () {
    //    //菜单项选中的高亮
    //    var currentURL = window.location.href;
    //    var arr = $("#leftMenus").find("a");
    //    for (var i = 0; i < arr.length; i++) {
    //        var href = arr[i].href;
    //        if (currentURL.indexOf(href) != -1) {
    //            $(arr[i]).addClass("nleftGaoLiang");
    //            break;
    //        }
    //    }
    //});
</script>